package com.jc.oms.controller.order;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jc.business.order.XorderBusiness;
import com.jc.business.systemloglist.SystemLogListBusiness;
import com.jc.common.util.ExceptionUtil;
import com.jc.oms.controller.BaseController;

@Controller
@RequestMapping("order")
public class XorderController extends BaseController {
	
	@Autowired
	XorderBusiness xorderBusiness;
	@Autowired
	SystemLogListBusiness systemLogListBusiness;
	
	@RequestMapping(value="push_order_jg")
	public @ResponseBody Map<String,Object> push_order_jg(){
		Map<String,Object> _ret = new HashMap<String,Object>();
		try {
			xorderBusiness.pushOrder();
			_ret.put("success", true);
		}catch (Exception e) {
			_ret.put("success", false);
			_ret.put("errorMsg", ExceptionUtil.subExceptionMessage(e, 0, 100));
		}
		
		return _ret;
		
	} 
	
	
	
	@RequestMapping(value="push_order_jg2",method = RequestMethod.GET)
	public @ResponseBody Map<String,Object> push_order_jg2(){
		Map<String,Object> _ret = new HashMap<String,Object>();
		try {
			xorderBusiness.pushOrder();
			_ret.put("success", true);
		}catch (Exception e) {
			_ret.put("success", false);
			_ret.put("errorMsg", ExceptionUtil.subExceptionMessage(e, 0, 100));
		}
		
		return _ret;
		
	} 
	
	

}
